package main

/**
 *
 * @param A int整型一维数组
 * @param B int整型一维数组
 * @return void
 */
func merge(A []int, m int, B []int, n int) {
	// write code here
	i, j, index := m-1, n-1, m+n-1
	for i >= 0 && j >= 0 {
		if A[i] > B[j] {
			A[index] = A[i]
			i--
		} else {
			A[index] = B[j]
			j--
		}
		index--
	}
	for j >= 0 {
		A[index] = B[j]
		index--
		j--
	}
}
